﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;

namespace GiveGraphModel
{
    public class ServiceRequest
    {
        public int ServiceRequestId { get; set; }
        public int Slots { get; set; }
        
        public virtual Organization Organization { get; set; }
        public virtual ServiceCategory Category { get; set; }
        public virtual ICollection<Schedule> Schedulers { get; set; }
        public virtual ICollection<SpecialtyArea> SpecialtyAreas { get; set; }
        public virtual ICollection<String> TypeOfVolunteering { get; set; }

    }

    public sealed class ServiceRequestConfiguration : EntityTypeConfiguration<ServiceRequest>
    {
        public ServiceRequestConfiguration()
        {
            HasRequired( sr => sr.Organization );
            HasMany( sr => sr.Schedulers   ).WithMany();
            HasRequired(sr => sr.Category);
            
            HasMany(p => p.SpecialtyAreas).WithMany();
            

        }
    }
}
